package com.chrray.position.controller.web;


import com.chrray.position.domain.FdCustomerService;
import com.chrray.position.pojo.dto.util.BaseAllDto;

import com.chrray.position.service.web.WFdCustomerServiceService;
import com.chrray.position.util.result.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import static com.chrray.position.util.result.ResponseResults.PAGE;
import static com.chrray.position.util.result.ResponseResults.success;

/**
 * 意见反馈表控制器
 *
 * @author lm
 * @since 1.0.1 2024-09-02
 */
@RestController
@RequestMapping("/api/web/customer")
@Api(tags = "电话客服")
@AllArgsConstructor
public class WFdCustomerController {
    @Autowired
    private WFdCustomerServiceService wFdCustomerServiceService;


    @GetMapping("/selectOne")
    @ApiOperation("查询详情")
    @ApiResponses({
            @ApiResponse(code=200, message = "ok", response = FdCustomerService.class)
    })
    public ResponseResult<FdCustomerService> selectOne(BaseAllDto dto){
        return  success(wFdCustomerServiceService.selectOne());
    }

    @PostMapping("/save")
    @ApiOperation("保存")
    @ApiResponses({
            @ApiResponse(code=200, message = "ok", response = FdCustomerService.class)
    })
    public ResponseResult save(@RequestBody FdCustomerService entity){
        return  wFdCustomerServiceService.saveCustomer(entity);
    }
}
